#!/bin/sh
dir=/root/mywork/dir1
if [ -f $dir ] ; then
  echo "$dir"
else
  echo "not exist"
fi

exit 0;

chu y
-f $dir vi la de chack file nen du ton tai thu muc ma ko ton tai file van tra ve false
nen de check thu muc ton tai hay ko dung -d
#!/bin/sh
dir=/root/mywork/dir1
if [ -d $dir ] ; then
  echo "$dir"
else
  echo "not exist"
fi

exit 0;


#!/bin/sh
file=/root/mywork/dir1
if [ -f $dir ] ; then
  echo "ton tai file"
  echo "$dir"
else
  echo "not exist"
fi

if [ -z $dir ] ; then
 echo "null"
else
 echo "not null"
fi

exit 0